package com.hw.springcloud.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Classname: FeignHystrixOrderService
 * @Description: 服务接口
 *               @FeignClient(value = "CLOUD-PROVIDER-HYSTRIX-PAYMENT",fallback = FeignHystrixOrderFallBackServiceImpl.class)
 *               表示如果CLOUD-PROVIDER-HYSTRIX-PAYMENT服务出现错误,无法正常使用的情况下就用FeignHystrixOrderFallBackServiceImpl实现类中对应的方法进行兜底处理
 * @Date: 2021/9/16
 * @Author: huwei
 */
@Component
@FeignClient(value = "CLOUD-PROVIDER-HYSTRIX-PAYMENT",fallback = FeignHystrixOrderFallBackServiceImpl.class)
public interface FeignHystrixOrderService {

    @GetMapping("/hystrix/payment/success/{id}")
    String getDataInfoSuccess(@PathVariable("id") String id);


    @GetMapping("/hystrix/payment/error/{id}")
    String getDataInfoError(@PathVariable("id") String id);
}
